<!-- tabbar:调查: investigate -->
<template>
	<view class="index-body">
		<view class="top-tabs">
			<pTabs @tabsClick="tabsClick"></pTabs>
			<u-divider></u-divider>
			<view class="tabs-input-con">
				<indexSearchInput></indexSearchInput>
			</view>
		</view>
		<scroll-view scroll-y class="content">
			<u-cell-group>
				<u-cell v-for="(item) in itemIndex" :key="item" :isLink="true" size="large" :title="'xxx水源' + item"
					label="昆明市五华区地下水型饮用水源" @click="clickCell">
					<text slot="value" class="tag-text-red">退回</text>
				</u-cell>
			</u-cell-group>
		</scroll-view>
	</view>
</template>

<script>
	import indexSearchInput from '../components/indexSearchInput.vue';
	export default {
		components: {
			indexSearchInput
		},
		data() {
			return {
				itemIndex: 5,
			}
		},
		methods: {
			/**
			 * 选择tabs项
			 */
			tabsClick({
				value,
				name
			}) {
				console.log('选择tabs项', value, name);
				if (value == 0) {
					this.itemIndex = 5;
				} else {
					this.itemIndex = 20;
				}
			},
			clickCell() {
				console.log('点击cell');
				uni.navigateTo({
					url: '/pages/investigate/basicInvestigationCon',
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
	.index-body {
		// height: calc(100vh - 80px);
		overflow: hidden;

		.tabs-input-con {
			padding: $padding-sm $padding-lg;
		}

		.content {
			max-height: calc(100vh - 190px);
			padding: 0 $padding-lg $padding-lg $padding-lg;

			.tag-text-red {
				color: white;
				background-color: $uni-color-error;
				border-radius: $padding-lg;
				padding: 0 $padding-sm;
			}
		}
	}
</style>